package com.xiaomaoguai.guava.order;

import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.collect.Ordering;
import com.google.common.primitives.Ints;

/**
 * @Description :
 * @FileName: MainTest.java
 * @Author :WeiHui.Zhang
 * @Data : 2015年11月4日 下午2:39:32
 * @Version:V1.00
 */
public class MainTest {

	public static void main(String[] args) {
		Ordering<String> byLengthOrdering = new Ordering<String>() {

			public int compare(String left, String right) {
				return Ints.compare(left.length(), right.length());
			}
		};
		
		String max = byLengthOrdering.max("ab", "ddd");
		
		System.out.println(max);
		
		System.out.println(Splitter.on("sb").splitToList("nisbme"));
		
		System.out.println(Joiner.on('f').join("a", "dd", "dd"));
		
	}
}
